namespace DotNetNuke.Services.Log.SiteLog
{
    using DotNetNuke.Data;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections;

    public class BufferedSiteLog
    {
        public ArrayList SiteLog;
        public string SiteLogStorage;

        public void AddSiteLog()
        {
            try
            {
                SiteLogController objSiteLogs = new SiteLogController();
                int refIntHelperL0 = this.SiteLog.Count - 1;
                for (int intIndex = 0; intIndex <= refIntHelperL0; intIndex++)
                {
                    SiteLogInfo objSiteLog = (SiteLogInfo) this.SiteLog[intIndex];
                    switch (this.SiteLogStorage)
                    {
                        case "D":
                            DataProvider.Instance().AddSiteLog(objSiteLog.DateTime, objSiteLog.PortalId, objSiteLog.UserId, objSiteLog.Referrer, objSiteLog.URL, objSiteLog.UserAgent, objSiteLog.UserHostAddress, objSiteLog.UserHostName, objSiteLog.TabId, objSiteLog.AffiliateId);
                            break;

                        case "F":
                            objSiteLogs.W3CExtendedLog(objSiteLog.DateTime, objSiteLog.PortalId, objSiteLog.UserId, objSiteLog.Referrer, objSiteLog.URL, objSiteLog.UserAgent, objSiteLog.UserHostAddress, objSiteLog.UserHostName, objSiteLog.TabId, objSiteLog.AffiliateId);
                            break;
                    }
                }
            }
            catch (Exception exception1)
            {
                
                Exception ex = exception1;
                
            }
        }
    }
}

